package jtest.com.cpi.cornpp.purchaseorder.service;

import com.cpi.cornpp.purchase.program.exception.PurchaseProgramException;
import com.cpi.cornpp.purchaseorder.service.PurchaseOrderCostVersionService;
import com.cpi.cornpp.purchaseorder.view.PurchaseOrderCostVersionView;

import junit.framework.TestCase;

public class PurchaseOrderCostVersionServiceTest extends TestCase {

	public PurchaseOrderCostVersionServiceTest(String name) {
		super(name);
	}

	protected void setUp() throws Exception {
		super.setUp();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testDeletePurchaseOrderCostVersion() {
		PurchaseOrderCostVersionService purchaseOrderCostVersionService = null;
		PurchaseOrderCostVersionView purchaseOrderChargeVersionView = null;
		try{
			purchaseOrderCostVersionService = new PurchaseOrderCostVersionService();
			purchaseOrderChargeVersionView = new PurchaseOrderCostVersionView();
			purchaseOrderChargeVersionView.setCostElementId(new Integer(1));
			purchaseOrderChargeVersionView.setPurchaseOrderVersionId(new Integer(1196));
			purchaseOrderCostVersionService.deletePurchaseOrderCostVersion(purchaseOrderChargeVersionView);
		}catch(PurchaseProgramException purchaseProgramException){
			fail(purchaseProgramException.getMessage());
		}
	}

	public void testAddPurchaseOrderCostVersion() {
		PurchaseOrderCostVersionService purchaseOrderCostVersionService = null;
		PurchaseOrderCostVersionView purchaseOrderChargeVersionView = null;
		try{
			purchaseOrderCostVersionService = new PurchaseOrderCostVersionService();
			purchaseOrderChargeVersionView = new PurchaseOrderCostVersionView();
			purchaseOrderChargeVersionView.setAmount(new Double(1100));
			purchaseOrderChargeVersionView.setCostElementId(new Integer(1));
			purchaseOrderChargeVersionView.setPurchaseOrderVersionId(new Integer(1196));
			purchaseOrderCostVersionService.addPurchaseOrderCostVersion(purchaseOrderChargeVersionView);
		}catch(PurchaseProgramException purchaseProgramException){
			fail(purchaseProgramException.getMessage());
		}
	}
}